import React, { Component } from 'react'
import p_01 from '../assert/imgs/pic/01.png'
import '../assert/css/GoodsDetail.css'
export default class GoodsDetail extends Component {
    state = {
        goods_detail: {}
    }
    get_goods(id) {
        this.$axios.get('/getgoodsinfo?id=' + id).then(res => {
            this.setState({ goods_detail: res.list[0] })
            console.log(res.list[0]);
        })
    }
    componentWillMount() {
        let id = this.props.match.params.id
        this.get_goods(id)
    }
    render() {
        let { goods_detail } = this.state
        return (
            <div>
                <div className="page-title">商品详情</div>
                {/* <!-- 商品详情 --> */}
                {
                    
                        <div className="detail">
                            <img src={this.$static_host + goods_detail.img} alt="" className='detail_img' />
                            <div>
                                <h3 className="price">&yen;{goods_detail.price}</h3>
                                <p>{goods_detail.goodsname}</p>
                            </div>
                        </div>
                   
                }

                {/* <!-- 底部导航 --> */}
                <ul className="cartbar">
                    <li>
                        <div className="icon icon-concat"></div>
                        <p>客服</p>
                    </li>
                    <li>
                        <div className="icon icon-shop"></div>
                        <p>店铺</p>
                    </li>
                    <li>
                        <div className="icon icon-cart"></div>
                        <p>购物车</p>
                    </li>
                    <li className="btn-cart">
                        加入购物车
                    </li>
                    <li className="btn-buy">
                        立即购买
                    </li>
                </ul>
            </div>
        )
    }
}
